import cn from 'classnames';
import React, { useState, useEffect, useMemo } from 'react';
import PropTypes from 'prop-types';
import { withRouter } from 'react-router';
import Breadcrumb, { Item } from '../../components/Breadcrumb';
import s from './style.module.css';
import HostAdd from './HostAdd';
import WebAdd from './WebAdd';

function Batch({
	match: {
		params: { assetType },
	},
}) {
	return (
		<div className={s.body}>
			{assetType === 'host' ? (
				<>
					<Breadcrumb className={s.bread}>
						<Item key="asset-manage" disabled>
							资产管理
						</Item>
						<Item key="manage/host">主机资产</Item>
						<Item key="">批量添加</Item>
					</Breadcrumb>
					<HostAdd />
				</>
			) : (
				<WebAdd />
			)}
		</div>
	);
}
Batch.propTypes = {
	className: PropTypes.string,
	history: PropTypes.shape({
		push: PropTypes.func.isRequired,
		replace: PropTypes.func.isRequired,
	}).isRequired,
	location: PropTypes.shape({
		search: PropTypes.string.isRequired,
	}).isRequired,
	match: PropTypes.shape({
		params: PropTypes.shape({
			assetType: PropTypes.string.isRequired,
		}).isRequired,
	}).isRequired,
};
export default withRouter(Batch);
